package zheezes.protocol.impl.gbw.afn8c;

import zheezes.protocol.impl.gbw.DataUnit;

public class Afn8CDownF1DataUnit extends DataUnit {
	private byte type;
	
	public Afn8CDownF1DataUnit() {
		id.setPn((short) 0);
		id.setFn((short) 1);
		type = 0x03;
	}
	
	@Override
	public int sizeOfData() {
		return 1;
	}

	@Override
	public int getData(byte[] buf, int offset) {
		int idx = offset;
		buf[idx++] = type;
		return idx - offset;
	}

	@Override
	public int setData(byte[] buf, int offset, int max) {
		int idx = offset;
		type = buf[idx++];
		return idx - offset;
	}
}
